package com.wongoing.util.manager;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * 功能说明：验证码内存管理内
 * 修改说明：
 * @author 吴兆强
 * @date 2018年1月25日 上午11:15:28
 * @version V0.1
 */
public class SmsVerCodeManager {
	
	private static SmsVerCodeManager instance = new SmsVerCodeManager();
	
	private SmsVerCodeManager(){
		
	}
	
	public static SmsVerCodeManager getInstance(){
		if(null == instance) instance = new SmsVerCodeManager();
		return instance;
	}
	
	private Map<String,SmsVerCodeManagerBean> map = new HashMap<String, SmsVerCodeManagerBean>();
	
	public void addVerCode(String tel,SmsVerCodeManagerBean vercode){
		map.put(tel, vercode);
	}
	
	public void removeVerCode(String tel){
		map.remove(tel);
	}
	
	public SmsVerCodeManagerBean getVerCode(String tel){
		return map.get(tel);
	}
	
	public Collection<SmsVerCodeManagerBean> getAllVerCode(){
		return map.values();
	}

}
